
//购物车
$('.buy').hover(function(){
	$(this).css({'background':'white'});
	$('.buycon').css({'background':'url(./images/buy1.png) no-repeat','backgroundSize':'20px 14px','color':'#ff6700'})
	$('.buycar').stop().slideDown();
},function(){
	$(this).css({'background':'#424242'});
	$('.buycon').css({'background':'url(./images/buy.png) no-repeat','backgroundSize':'20px 14px','color':'#959696'});
	$('.buycar').stop().slideUp();
});

// 导航栏 $('.head')
$('.nav>ul>li').hover(function(){
	$(this).children('.headernav').stop().slideDown();
},function(){
	$(this).children('.headernav').stop().slideUp();
});


//搜索框
$('.searchbox').focus(function(){
	$('.searchbox').css({'border':'1px solid #ff6700','borderRight':'none'});
	$('.searchbut').css({'border':'1px solid #ff6700'});
	// $('.kuang p').css('display','none');
	$('.kuang p').fadeOut();
	$('.searchcon').fadeIn();
});

$('.searchbox').blur(function(){
	$('.searchbox').css({'border':'1px solid #f5f5f5','borderRight':'none'});
	$('.searchbut').css({'border':'1px solid #f5f5f5'});
	$('.kuang p').fadeIn();
	$('.searchcon').fadeOut();
	// $('.kuang p').css('display','block');
});





// 轮播图
var num=0;
var clock;
clock = setInterval(autoPlay, 2000);
function goTo(){
		$('.img .ulsimg li').fadeOut('fast');
		$('.img .ulsimg li').eq(num).fadeIn('fast');
		$('.uls li').css('background','#867d6d');
		$('.uls li').eq(num).css('background','#ede3d4');
}
$('.button2').click(function(){
	num++;
	if(num>4){
		num=0;
	}
	goTo();
});
$('.button1').click(function(){
	num--;
	if(num<0){
		num=4;
	}
	goTo();
});
function autoPlay(){
	num++;
	if(num>=$('.img .ulsimg li').length){
		num=0;
	};
	goTo();
};
$('.ulsimg img').mouseover(function(){
	clearInterval(clock);
}).mouseout(function(){
	clock = setInterval(autoPlay,2000);
});
$('.button1').mouseover(function(){
	clearInterval(clock);
	$(this).css('background','url(./images/icon-slides.png) no-repeat 0px 0px');
}).mouseout(function(){
	clock = setInterval(autoPlay, 2000);
	$(this).css('background','url(./images/icon-slides.png) no-repeat -85px 0px');
});
$('.button2').mouseover(function(){
	clearInterval(clock);
	$(this).css('background','url(./images/icon-slides.png) no-repeat -43px 0px');
}).mouseout(function(){
	clock = setInterval(autoPlay, 2000);
	$(this).css('background','url(./images/icon-slides.png) no-repeat -125px 0px');
});

$('.dapei1 .productsChange').mouseover(function(){
	$('.dapei1 .productsChange').children('span').css({color:'#434343',textDecoration:'none'});
	$('.dapei1 .productsChange').children('.dapeiproduct').css('display','none');
	$(this).children('span').css({color:'#ff6709',textDecoration:'underline'});
	$(this).children('.dapeiproduct').css('display','block');
});
$('.peijian .productsChange').mouseover(function(){
	$('.peijian .productsChange').children('span').css({color:'#434343',textDecoration:'none'});
	$('.peijian .productsChange').children('.dapeiproduct').css('display','none');
	$(this).children('span').css({color:'#ff6709',textDecoration:'underline'});
	$(this).children('.dapeiproduct').css('display','block');
});
$('.zhoubian .productsChange').mouseover(function(){
	$('.zhoubian .productsChange').children('span').css({color:'#434343',textDecoration:'none'});
	$('.zhoubian .productsChange').children('.dapeiproduct').css('display','none');
	$(this).children('span').css({color:'#ff6709',textDecoration:'underline'});
	$(this).children('.dapeiproduct').css('display','block');
});



//内容部分
$('.neirong>ul>li').hover(function(){
	$(this).children('div').css('display','block');
},function(){
	$(this).children('div').css('display','none');
});
$('.neirong div').hover(function(){
	$(this).css('background','#8D8D8D')
},function(){
	$(this).css('background','#D9D9D9')
});


$('.b4 .b4A .next').click(function(){
	$('.b4 .b4C li').css('transform','translateX(-1240px)');
});
$('.b4 .b4A .top').click(function(){
	$('.b4 .b4C li').css('transform','translateX(0px)');
});



// $('.tuijian .tuijianA .next').click(function(){
// 	$('.tuijian .tuijianC li').css{'transform','translateX('+num1+'px)'}
// });

var con5=0
function move5(){
	var con5=0;
	$('.next1').click(function(){
		con5+=1;
		if(con5>2){
			con5=2;
		};
		l1=-1240*con5;
		changepic1(l1);
		return con5;
		
	});

	$('.top1').click(function(){
		con5-=1;
		if(con5<0){
			con5=0;
		};
		l1=-1240*con5;
		changepic1(l1);
		return con5;
		
	});
	
	function changepic1(num1){
		$('.tuijianC li').css('transform','translateX('+num1+'PX)');
		
	}
};
move5();




var con1=0
function move1(){
	var con1=0;
	$('.bookRight').click(function(){
		con1+=1;
		if(con1>3){
			con1=3;
		};
		l1=-301*con1;
		changepic1(l1,con1);
		return con1;
		
	});

	$('.bookLeft').click(function(){
		con1-=1;
		if(con1<0){
			con1=0;
		};
		l1=-301*con1;
		changepic1(l1,con1);
		return con1;
		
	});
	$('.note1 li').click(function(){
		con1 = $(this).index();
		n1=-301*con1;
		changepic1(n1,con1);
		return con1;
	});
	function changepic1(num1,num2){
		$('.tushu li').css('transform','translateX('+num1+'PX)');
		$('.note1 li').css({'width':'6px','height':'6px','background':'#b0b0b0','border':'none','marginTop':' 2px'});
		$('.note1 li').eq(num2).css({'width':'6px','height':'6px','border':'2px solid #ff6700','background':'white','marginTop':'0px'});
	}

};
move1();


var con2=0
function move2(){
	var con2=0;
	$('.zhutiRight').click(function(){
		con2+=1;
		if(con2>3){
			con2=3;
		};
		l2=-301*con2;
		changepic2(l2,con2);
		return con2;
		
	});

	$('.zhutiLeft').click(function(){
		con2-=1;
		if(con2<0){
			con2=0;
		};
		l2=-301*con2;
		changepic2(l2,con2);
		return con2;
		
	});
	$('.note2 li').click(function(){
		con2 = $(this).index();
		n2=-301*con2;
		changepic2(n2,con2);
		return con2;
	});
	function changepic2(num1,num2){
		$('.zhuti li').css('transform','translateX('+num1+'PX)');
		$('.note2 li').css({'width':'6px','height':'6px','background':'#b0b0b0','border':'none','marginTop':' 2px'});
		$('.note2 li').eq(num2).css({'width':'6px','height':'6px','border':'2px solid #ff6700','background':'white','marginTop':'0px'});
	}

};
move2();


var con3=0
function move3(){
	var con3=0;
	$('.gameRight').click(function(){
		con3+=1;
		if(con3>3){
			con3=3;
		};
		l3=-301*con3;
		changepic2(l3,con3);
		return con3;
		
	});

	$('.gameLeft').click(function(){
		con3-=1;
		if(con3<0){
			con3=0;
		};
		l3=-301*con3;
		changepic2(l3,con3);
		return con3;
		
	});
	$('.note3 li').click(function(){
		con3 = $(this).index();
		n3=-301*con3;
		changepic2(n3,con3);
		return con3;
	});
	function changepic2(num1,num2){
		$('.game li').css('transform','translateX('+num1+'PX)');
		$('.note3 li').css({'width':'6px','height':'6px','background':'#b0b0b0','border':'none','marginTop':' 2px'});
		$('.note3 li').eq(num2).css({'width':'6px','height':'6px','border':'2px solid #ff6700','background':'white','marginTop':'0px'});
	}

};
move3();

var con4=0
$('.useLeft').click(function(){
		con4-=1;
		if(con4<0){
			con4=0;
		}
		l4=-301*con4;
		changepic4(l4,con4);
});
$('.useRight').click(function(){
		con4+=1;
		if(con4>3){
			con4=3;
		}
		l4=-301*con4;
		changepic4(l4,con4);
});
$('.note4 li').click(function(){


	con4=$(this).index();
	n4=-301*con4;
	changepic4(n4,con4);
});
$('.note li').hover(function(){
	if($(this).css('marginTop')=='2px'){
		$(this).css('background','#ff6700');
	};
	$(this).css("cursor","pointer");
},function(){
	if($(this).css('marginTop')=='2px'){
		$(this).css('background','#b0b0b0');
	};
});



function changepic4(num1,num2){
	$('.use li').css('transform','translateX('+num1+'PX)');
	$('.note4 li').css({'width':'6px','height':'6px','background':'#b0b0b0','border':'none','marginTop':' 2px'});
	$('.note4 li').eq(num2).css({'width':'6px','height':'6px','border':'2px solid #ff6700','background':'white','marginTop':'0px'});
}